﻿using System;
using System.Linq;
using System.Collections.Generic;
using DevExpress.CodeRush.StructuralParser;

namespace CR.StyleCop.Naming {

    public class InterfaceNamesMustBeginWithISearcher : BaseStyleCopIssueSearcher<IInterfaceElement> {
        public override IEnumerable<StyleCopIssue> FindIssues(IEnumerable<IInterfaceElement> elements) {
            return elements.Where(i => i.Name[0] != 'I')
                .Select(i => new StyleCopIssue {
                    Element = i,
                    IssueDescription = StyleCop.Resource.InterfaceNamesMustBeginWithISearcherIssueDescription
                });
        }
    }
}
